feat(automation): Phase 6.1 – Production Validation helpers, CLI and tests - #2495
Conversation
…d tests Closes #2043 - production-validation-helpers.js: five Phase 6.1 deliverable functions (runDeploymentChecklist, setupProductionEnvironment, runSmokeTests, validateRollbackPlan, configureMonitoring) plus parseProductionArguments and executeAllProductionValidations - production-validation.js: CLI script mirroring staging-validation.js - __tests__/production-validation.test.js: 56 unit, integration, and edge-case tests – all passing
…terministic durationMs in runSmokeTests
There was a problem hiding this comment.
🟡 Changes recommended
There are API/CLI usability issues (empty override arrays silently falling back to defaults and failures not surfacing error messages) plus a potentially risky lockfile change removing libc constraints for native optional deps.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a Phase 6.1 “production validation” automation module (helpers + CLI) under scripts/automation/, modelled on the existing staging validation pattern, plus a Jest test suite to exercise the new helpers.
Changes:
- Added
production-validation-helpers.jswith pure helper functions for checklist, environment, smoke tests, rollback validation, monitoring config, arg parsing, and orchestration. - Added
production-validation.jsCLI entrypoint to run a single task or all checks and set process exit codes accordingly. - Added
production-validation.test.jsJest suite covering defaults, overrides, and edge cases for the helpers.
File summaries
| File | Description |
|---|---|
| scripts/automation/production-validation.js | New CLI wrapper for running Phase 6.1 production validation tasks and reporting results. |
| scripts/automation/production-validation-helpers.js | New helper module implementing the production validation task functions and orchestration. |
| scripts/automation/tests/production-validation.test.js | New Jest coverage for the production validation helper functions. |
| package-lock.json | Lockfile update removing libc constraints from several platform-specific optional native packages. |
Review details
Suppressed comments (1)
scripts/automation/production-validation-helpers.js:220
- Similar to the checklist helper, providing
options.channels: []currently falls back to the default channels. This is surprising for an API that accepts overrides and makes it hard to intentionally configure zero channels during testing. Only default whenoptions.channelsisundefined, and fail fast on an empty array.
const channels =
options.channels && options.channels.length > 0
? options.channels
: defaultChannels;
- Files reviewed: 3/4 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ash Shaw <ashley@lightspeedwp.agency>
|
Missing required section(s): Linked issues, Changelog, Global DoD checklist This is a post-merge backstop for admin bypasses. Please review branch protection for develop. |
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
2 similar comments
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
|
This PR's branch name Standard pattern: Based on linked issue type: Correct template should be: No action required — this is informational. Future PRs should use the correct branch name. See Branching Strategy for more info. |
🔍 Reviewer Summary for PR #2495CI Status: ❌ Recommendations
|
❌ Branch Name Validation FailedThe branch name Required Format
Allowed Branch Types
Valid Examples
Invalid Examples
SolutionRename your branch to follow the pattern and update the PR. For more information, see docs/BRANCHING_STRATEGY.md. |
|
@copilot resolve the merge conflicts in this pull request |
…agent-v2-phase-6-1 # Conflicts: # package-lock.json
Head branch was pushed to by a user without write access
Resolved — I merged |
Summary
Implements Phase 6.1 production validation deliverables (deployment checklist, environment setup, smoke tests, rollback plan, monitoring/alerting) as a testable Node.js module with CLI wrapper.
Changes Made
Added
production-validation-helpers.js— Pure functions for each deliverable:runDeploymentChecklist— Verifies deployment checklist itemssetupProductionEnvironment— Confirms services are running and healthyrunSmokeTests— Exercises key production endpointsvalidateRollbackPlan— Asserts plan is documented and testedconfigureMonitoring— Wires notification channels and validates alert thresholdsexecuteAllProductionValidations— Orchestrates all five, returns GO/NO-GO + summaryproduction-validation.js— CLI wrapper supporting:--task <name>or--allfor individual or bulk execution--verbose,--no-dry-run,--max-rollbackflagsproduction-validation.test.js— 56 comprehensive unit, integration, and edge-case tests (0 CodeQL alerts)Linked Issue
Resolves #2043
🤖 Generated with Claude Code